/* 全局样式 */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: #f8f9fa;
    color: #333;
}

/* 导航栏样式 */
.navbar {
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.navbar-brand {
    font-weight: bold;
    font-size: 1.25rem;
}

/* 容器样式 */
.container {
    max-width: 1200px;
}

/* 卡片样式 */
.card {
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    border: none;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.card-header {
    background-color: #fff;
    border-bottom: 1px solid #e9ecef;
    padding: 1rem 1.25rem;
    font-weight: 600;
    color: #495057;
}

.card-body {
    padding: 1.5rem;
}

/* 财务摘要卡片 */
.summary-card {
    border-radius: 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    transition: all 0.3s ease;
}

.summary-card.income-card {
    background: linear-gradient(135deg, #4ade80 0%, #22c55e 100%);
}

.summary-card.expense-card {
    background: linear-gradient(135deg, #f87171 0%, #ef4444 100%);
}

.summary-card.balance-card {
    background: linear-gradient(135deg, #60a5fa 0%, #3b82f6 100%);
}

.summary-card .card-title {
    font-size: 1rem;
    opacity: 0.9;
    margin-bottom: 0.5rem;
}

.summary-card .amount {
    font-size: 2rem;
    font-weight: bold;
    margin-bottom: 0;
}

/* 按钮样式 */
.btn {
    border-radius: 6px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.15);
}

.btn-primary {
    background-color: #3b82f6;
    border-color: #3b82f6;
}

.btn-primary:hover {
    background-color: #2563eb;
    border-color: #1d4ed8;
}

.btn-success {
    background-color: #22c55e;
    border-color: #22c55e;
}

.btn-success:hover {
    background-color: #16a34a;
    border-color: #15803d;
}

.btn-danger {
    background-color: #ef4444;
    border-color: #ef4444;
}

.btn-danger:hover {
    background-color: #dc2626;
    border-color: #b91c1c;
}

/* 表格样式 */
.table {
    background-color: white;
    border-radius: 8px;
    overflow: hidden;
}

.table th {
    background-color: #3b82f6;
    color: white;
    font-weight: 500;
    text-align: center;
}

.table td {
    text-align: center;
    vertical-align: middle;
}

.table-hover tbody tr:hover {
    background-color: #f1f5f9;
}

/* 表单样式 */
.form-control {
    border-radius: 6px;
    border: 1px solid #ddd;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-control:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-label {
    font-weight: 500;
    color: #495057;
}

/* 消息提示样式 */
.alert {
    border-radius: 6px;
    margin-bottom: 1.5rem;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 进度条样式 */
.progress {
    border-radius: 10px;
    overflow: hidden;
}

.progress-bar {
    transition: width 0.6s ease;
    font-weight: 500;
}

/* 图标样式 */
.fa {
    margin-right: 5px;
}

.text-green {
    color: #22c55e;
}

.text-red {
    color: #ef4444;
}

.text-blue {
    color: #3b82f6;
}

/* 模态框样式 */
.modal-content {
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    border: none;
}

.modal-header {
    background-color: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
    border-radius: 12px 12px 0 0;
}

.modal-title {
    font-weight: 600;
    color: #495057;
}

.modal-footer {
    border-top: 1px solid #e9ecef;
}

/* 分页样式 */
.pagination {
    justify-content: center;
    margin-top: 1.5rem;
}

.page-item.active .page-link {
    background-color: #3b82f6;
    border-color: #3b82f6;
}

.page-link {
    color: #3b82f6;
    border-radius: 6px;
    margin: 0 2px;
    transition: all 0.2s ease;
}

.page-link:hover {
    color: #2563eb;
    background-color: #f1f5f9;
    border-color: #ddd;
}

/* 统计图表容器 */
.chart-container {
    position: relative;
    margin: auto;
}

/* 选择框样式 */
select.form-select {
    cursor: pointer;
}

/* 工具提示样式 */
.tooltip-inner {
    background-color: #3b82f6;
    border-radius: 6px;
}

/* 日期选择器样式 */
input[type="date"] {
    cursor: pointer;
}

/* 复选框和单选框样式 */
.form-check-input {
    cursor: pointer;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: 0 1rem;
    }
    
    .card {
        margin-bottom: 1rem;
    }
    
    .summary-card .amount {
        font-size: 1.5rem;
    }
    
    .navbar-nav {
        margin-top: 0.5rem;
    }
    
    .nav-item {
        margin-bottom: 0.25rem;
    }
    
    .table-responsive {
        overflow-x: auto;
    }
    
    .row > div {
        margin-bottom: 1rem;
    }
}

@media (max-width: 480px) {
    h2 {
        font-size: 1.5rem;
    }
    
    h3 {
        font-size: 1.25rem;
    }
    
    .card-header {
        padding: 0.75rem 1rem;
    }
    
    .card-body {
        padding: 1rem;
    }
}

/* 特定页面样式 */
/* 交易管理页面 */
.transaction-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    flex-wrap: wrap;
}

.filter-container {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 1rem;
    align-items: center;
}

@media (max-width: 768px) {
    .filter-container {
        flex-direction: column;
        align-items: stretch;
    }
    
    .filter-container select,
    .filter-container input,
    .filter-container button {
        width: 100%;
    }
}

/* 报表页面 */
.report-card {
    margin-bottom: 1.5rem;
}

/* 设置页面 */
.list-group-item {
    cursor: pointer;
    transition: all 0.2s ease;
}

.list-group-item:hover {
    background-color: #f1f5f9;
}

.list-group-item.active {
    background-color: #3b82f6;
    border-color: #3b82f6;
}

/* 数据导入导出样式 */
.data-import-export {
    display: flex;
    gap: 10px;
    align-items: flex-start;
}

@media (max-width: 768px) {
    .data-import-export {
        flex-direction: column;
    }
    
    .data-import-export > div {
        width: 100%;
    }
}

/* 卡片阴影效果 */
.shadow-sm {
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.shadow-md {
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.shadow-lg {
    box-shadow: 0 10px 15px rgba(0,0,0,0.1);
}

/* 动画效果 */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.slide-in {
    animation: slideIn 0.5s ease;
}

/* 加载动画 */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(59, 130, 246, 0.3);
    border-radius: 50%;
    border-top-color: #3b82f6;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* 打印样式 */
@media print {
    .navbar,
    .btn,
    .form-control,
    .pagination {
        display: none !important;
    }
    
    .card {
        box-shadow: none;
        border: 1px solid #ddd;
        page-break-inside: avoid;
    }
    
    body {
        background-color: white;
    }
}